package task4;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.BitSet;
import java.util.function.BooleanSupplier;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/5/4 8:09
 * @description:
 */
public class CopyMp4 {

  public static void main(String[] args) {
    BufferedInputStream bis=null;
    BufferedOutputStream bos=null;
    try {
      //创建字节缓冲流对象
      bis =new BufferedInputStream(new FileInputStream("1.mp4"));
      bos =new BufferedOutputStream(new FileOutputStream("c:\\美女.mp4"));
      byte[] bys=new byte[1024];
      int len=0;
      while ((len=bis.read(bys))!=-1){
        bos.write(bys,0,len);
      }
    }catch(Exception e){
      System.out.println(e.getMessage());

  }finally {
      if(bis!=null){
        try {
          bis.close();
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
      if(bos!=null){
        try {
          bos.close();
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
    }
  }

}
